<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="commontaglib"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
      <link rel="stylesheet" href="<%=path%>/css/innerstyle.css" type="text/css" />
    <link rel="stylesheet" type="text/css" media="screen" href="<%=path%>/css/ui-lightness/jquery-ui-1.8.23.custom.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="<%=path%>/css/ui.jqgrid.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="<%=path%>/css/ui.multiselect.css" />
    <script type="text/javascript" src="<%=path%>/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="<%=path%>/js/jquery-ui-1.8.23.custom.min.js"></script> 
    <script type="text/javascript" src="<%=path%>/js/i18n/grid.locale-cn.js"></script>    
    <script type="text/javascript" src="<%=path%>/js/jquery.jqGrid.min.js"></script>
    <script type="text/javascript" src="<%=path%>/js/i18n/jquery.ui.datepicker-zh-CN.js"></script>

  </head>
  <script type="text/javascript">  
  
  
  // 查询
function search(){   

  var formdata = $("#form1").serialize();  
  $("#listgrid4jsdw").jqGrid('setGridParam',{url:'<%=path%>/jydz/dzjsdw.action?'+formdata,mtype:'post',page:1}).trigger("reloadGrid"); 
}

function searchmy(){   

  var formdata = $("#form2").serialize();  
  $("#listgrid4myjsdw").jqGrid('setGridParam',{url:'<%=path%>/jydz/dzmyjsdw.action?'+formdata,mtype:'post',page:1}).trigger("reloadGrid"); 
}

  
$(function(){ 
  jQuery("#listgrid4jsdw").jqGrid({
	   	url:'<%=path%>/jydz/dzjsdw.action',
		datatype: "json",
	   	colNames:['结算单位代码', '结算单位名称'],
	   	colModel:[
	   		
	   		{name:'jiesdwdm',index:'jiesdwdm', width:300, align:"right"},
	   		{name:'jiesdwmc',index:'jiesdwmc', width:300, align:"right", sortable:false}  		
	   	],
	   	
	   	 jsonReader: {
           repeatitems : false, 
           id: 'jiesdwbm'
         }, 
	   	rowNum:10,
	   	rowList:[10,20,30],
	   	pager: '#pager1',
	   	sortname: 'jiesdwbm',
		recordpos: 'left',
	    viewrecords: true,
	    sortorder: "desc",
		multiselect: true,
		loadError: function (r, st, error) {
	    $("#message").html("status is " + r.status+error+st);
	},
		caption: "结算单位"
	});
	
 jQuery("#listgrid4jsdw").jqGrid('navGrid','#pager1',{add:false,del:false,edit:false,position:'right'});


  jQuery("#listgrid4myjsdw").jqGrid({
	   	url:'<%=path%>/jydz/dzmyjsdw.action',
		datatype: "json",
	   	colNames:['结算单位代码', '结算单位名称'],
	   	colModel:[
	   		
	   		{name:'jiesdwdm',index:'jiesdwdm', width:300, align:"right"},
	   		{name:'jiesdwmc',index:'jiesdwmc', width:300, align:"right", sortable:false}  		
	   	],
	   	
	   	 jsonReader: {
           repeatitems : false, 
           id: 'jiesdwbm'
         }, 
         
         
	   	rowNum:10,
	   	rowList:[10,20,30],
	   	pager: '#pager2',
	   	sortname: 'jiesdwbm',
		recordpos: 'left',
	    viewrecords: true,
	    sortorder: "desc",
		multiselect: true,
		caption: "我的结算单位"
	});
	
 jQuery("#listgrid4myjsdw").jqGrid('navGrid','#pager2',{add:false,del:false,edit:false,position:'right'});
	
});


function Addjxdw(){   

 var s;
	s = jQuery("#listgrid4jsdw").jqGrid('getGridParam','selarrrow');
	alert(s);

}

  </script>  
  <body>
  <div id="best1">
<h2><span>定制结算单位</span></h2>

  <form id="form1" method="post">
<table id="list_search" cellpadding="0" cellspacing="0" border="0"> 
        <tr>
        	<td>
            	结算单位名称:            </td>
            <td>
            	<input type="text" class="longtextbox" name="bean.AA" />            </td>
            <td>
                <input name="button" type="button" id="chax" onClick="search();" value="查询"/></td>
           
        </tr>		
  </table>

  <input id="btnAdd" type="button"  value="添加"  onclick="Addjxdw();"/>
 
  </form>
   <table id="listgrid4jsdw"  class="scroll" cellpadding="0" cellspacing="0"></table>  
<div id="pager1"  class="scroll"></div>

 <h4>我的结算单位</h4>
   <form id="form2" method="post">
<table id="list_search" cellpadding="0" cellspacing="0" border="0"> 
        <tr>
        	<td>
            	结算单位名称:            </td>
            <td>
            	<input type="text" class="longtextbox" name="bean.AA" />            </td>
            <td>
                <input name="button" type="button" id="chax" onClick="searchmy();" value="查询"/></td>
           
        </tr>		
  </table>
  </form>
   <table id="listgrid4myjsdw"  class="scroll" cellpadding="0" cellspacing="0"></table>
  
<div id="pager2"  class="scroll"></div>
</div>
  </body>
</html>
